<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

// ajax 请求
Route::group(['middleware' => 'api','namespace' => 'Index'],function (){
    Route::get('home/banner','IndexController@banner');
    Route::get('home/home_product','IndexController@home_product');
    Route::post('home/home_icon','IndexController@home_icon');
    Route::post('home/category','IndexController@category');
    Route::get('ai/simulation','AiController@simulation');
    Route::post('user/register','LoginController@register');
    Route::post('user/login','LoginController@login');
    Route::post('user/user_info','UserController@user_info');
    Route::post('product/detail','ProductController@detail');
    Route::post('product/collection','ProductController@collection');
    Route::post('product/keyword_search','ProductController@keyword_search');
    Route::post('order/add','OrderController@add');
    Route::post('order/user_order','OrderController@order_list');
    Route::post('user/avatar_upload','UserController@avatar_upload');
    Route::post('user/edit_user','UserController@edit_user');
    Route::get('user/collection','UserController@collection');
    Route::post('category/get_category','CategoryController@get_category');
    Route::post('category/get_category_product','CategoryController@get_category_product');
});

Route::group(['middleware' => 'api','namespace' => 'Admin', 'prefix' => 'admin'],function (){
    Route::post('/user','IndexController@index');
});
